package com.eca.emas.daemon.shared;

import java.io.Serializable;
import java.sql.Timestamp;

public class SensorData implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7086788296914507034L;
	private int recordID;
	private int locationID = -1;
	private Sensor sensor;
	private float avgTemp;

	private Timestamp timestamp;

	public SensorData(int recordID, int locationID, Sensor sensor,
			float avgTemp, Timestamp timestamp) {
		super();
		this.recordID = recordID;
		this.locationID = locationID;
		this.sensor = sensor;
		this.avgTemp = avgTemp;
		this.timestamp = timestamp;
	}

	public SensorData() {

	}

	public int getRecordID() {
		return recordID;
	}

	public int getLocationID() {
		return locationID;
	}

	public float getAvgTemp() {
		return avgTemp;
	}

	public void setLocationID(int locationID) {
		this.locationID = locationID;
	}

	public Sensor getSensor() {
		return sensor;
	}

	public void setSensor(Sensor sensor) {
		this.sensor = sensor;
	}

	public void setAvgTemp(float avgTemp) {
		this.avgTemp = avgTemp;
	}

	public void setRecordID(int recordID) {
		this.recordID = recordID;
	}

	public Timestamp getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Timestamp timestamp) {
		this.timestamp = timestamp;
	}

	public boolean isValidData() {
		return !Float.isNaN(avgTemp) && timestamp != null && locationID != -1
				&& sensor != null;
	}

}
